package starlingui.component.itemRender
{
	import com.imcrl.component.itemRender.ListItemRender;
	import com.imcrl.core.ChooseState;
	
	import flash.display.BitmapData;
	import flash.display.Graphics;
	import flash.display.Shape;
	
	import starling.textures.Texture;
	
	import starlingui.component.drag.AbsIcon;
	import starlingui.component.drag.AbsSlot;
	
	public class PointItemRender extends ListItemRender
	{
		private var cricle:Texture;

		private var icon:AbsIcon;
		public function PointItemRender()
		{
			super();
			
			var r:int=5;
			var dr:int=r<<1;
			
			var shape:Shape=new Shape();
			var g:Graphics=shape.graphics;
			
			g.beginFill(0xffffff);
			g.drawCircle(r,r,r);
			g.endFill();
			
			var bmd:BitmapData=new BitmapData(dr,dr,true,0);
			bmd.draw(shape);
			
			cricle=Texture.fromBitmapData(bmd,false);
			
			icon=new AbsIcon(cricle);
			this.addChild(icon);
		}
		
		
		override public function set chooseState(value:int):void{
			if(value != ChooseState.SELECT){
				icon.color=0x666666;
			}else{
				icon.color=0xffffff;
			}
		}
	}
}